﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace sieuthi
{
    public partial class Adduser : Form
    {
        private SqlDataAdapter da = new SqlDataAdapter();
        private SqlCommand cmd = new SqlCommand();
        private SqlConnection conn = new SqlConnection(Threelayer.VO.core.connectionsring.ToString());
        private DataTable dt = new System.Data.DataTable();
        public Adduser()
        {
            InitializeComponent();
        }

        private void buttonX1_Click(object sender, EventArgs e)
        {
            cmd.Connection = conn;
            cmd.CommandType = CommandType.StoredProcedure;
            conn.Open();
            cmd.CommandText = "user_them";
            cmd.Parameters.Add("@Name", SqlDbType.NVarChar, 200).Value = ID.Text;
            cmd.Parameters.Add("@Password", SqlDbType.NVarChar, 200).Value = password.Text;
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            cmd.ExecuteNonQuery();
            MessageBox.Show("Them nguoi dung thanh cong!","Thanh Cong!",MessageBoxButtons.OK);
            conn.Close();
        }
    }
}
